package org.itheima.googleplay.manager;


/**
 * @包名: org.itheima.googleplay.manager
 * @类名: ThreadManager
 * @作者: 肖琦
 * @创建时间 : 2015-3-22 上午9:04:05
 * 
 * @描述: 线程管理
 * 
 * @SVN版本: $Rev: 20 $
 * @更新人: $Author: xq $
 * @更新时间: $Date: 2015-03-24 16:01:24 +0800 (星期二, 24 三月 2015) $
 * 
 * @更新描述:
 */
public class ThreadManager
{
	private static ThreadPoolProxy	mLongPool;
	private static Object			mLongLock		= new Object();

	private static ThreadPoolProxy	mDownloadPool;
	private static Object			mDownloadLock	= new Object();

	public static ThreadPoolProxy getLongRunPool()
	{
		if (mLongPool == null)
		{
			synchronized (mLongLock)
			{
				if (mLongPool == null)
				{
					mLongPool = new ThreadPoolProxy(3, 3, 5L);
				}
			}
		}
		return mLongPool;
	}
	
	/**
	 * 专门负责下载的线程池
	 * @return
	 */
	public static ThreadPoolProxy getDownloadPool()
	{
		if (mDownloadPool == null)
		{
			synchronized (mDownloadLock)
			{
				if (mDownloadPool == null)
				{
					mDownloadPool = new ThreadPoolProxy(3, 3, 5L);
				}
			}
		}
		return mDownloadPool;
	}

}
